from tortoise import fields
from tortoise.models import Model

class User(Model):
    """用户实体"""

    # id = fields.BigIntField(pk=True, index=True, description='主键')
    username = fields.CharField(max_length=32, null=False, default='', description='用户名')
    password = fields.CharField(max_length=100, null=False, default='', description='用户密码')
    mobile = fields.CharField(max_length=20, null=False, default='', description='电话')
    email = fields.CharField(max_length=50, null=False, default='', description='邮箱')
    nickname = fields.CharField(max_length=32, null=False, default='', description='用户昵称')
    avatar = fields.CharField(max_length=200, null=False, default='', description='头像')
    gender = fields.SmallIntField(null=False, default=0, description='用户性别: [0=保密, 1=男, 2=女]')
    intro = fields.CharField(max_length=200, null=False, default='', description='简介')
    status = fields.SmallIntField(null=False, default=1, description='状态: [0=停用, 1=正常]')
    is_deleted = fields.BooleanField(default=False, description='是否删除: [False=正常, True=删除]')
    is_gogogo = fields.BooleanField(default=False, description='是否删除: [False=正常, True=删除]')

    class Meta:
        table_description = "用户表"
        table = "user"
